package com.example.day12;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.util.Log;

public class MyReceiver extends BroadcastReceiver {
    public static int num=0;
    @Override
    public void onReceive(Context context, Intent intent) {
//        abortBroadcast();
        String aaa = intent.getExtras().getString("msg");
        Log.e("#####"+num,aaa+"@@@");
        num++;
//

//        MainActivity.textView.setText("那啥没信号了");
        MainActivity.textView.setText(aaa);

        Bundle bundle1=new Bundle();
        bundle1.putString("msg","aaaaaa");
        setResultExtras(bundle1);
//        if(num>=2){
//            Bundle bundle=getResultExtras(false);
//            Log.e("#####"+num,bundle.getString("msg")+"@@@####");
            abortBroadcast();
//        }
//
    }
}
